package com.blueheart.springcloud.bhitem.service;


import com.blueheart.springcloud.bhitem.pojo.Item;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class ItemService {

    private static final Map<Long, Item> MAP = new HashMap<Long, Item>();

    static {
        MAP.put(1L,new Item(1L,"商品标题1","http://pic1","商品描述1",1000L));
        MAP.put(2L,new Item(2L,"商品标题2","http://pic1","商品描述2",2000L));
        MAP.put(3L,new Item(3L,"商品标题3","http://pic1","商品描述3",3000L));
        MAP.put(4L,new Item(4L,"商品标题4","http://pic1","商品描述4",4000L));
        MAP.put(5L,new Item(5L,"商品标题5","http://pic1","商品描述5",5000L));
        MAP.put(6L,new Item(6L,"商品标题6","http://pic1","商品描述6",6000L));
        MAP.put(7L,new Item(7L,"商品标题7","http://pic1","商品描述7",7000L));
        MAP.put(8L,new Item(8L,"商品标题8","http://pic1","商品描述8",8000L));
    }

    public Item queryItemById(Long id){
        return MAP.get(id);
    }



}
